import pymysql

conn=pymysql.connect(host='localhost',port=3306,user="root",password="root",
                     db="hzdl_company",charset="utf8")

cur=conn.cursor()#生成游标对象
name=input("请输入要查询的用户信息：")
sql="select * from hzdl_emp where ename='%s';"%name
cur.execute(sql)

info=cur.fetchmany(3)
print(info)

cur.close()
conn.close()